﻿using System;
using System.Collections.Generic;
using System.Text;

namespace EmbeddedSharp.Scripting.Function.Mathematics {
    public sealed class StatisticsCore {

        public static double Sum(double[] p) {
            double sum = 0;

            foreach (double d in p) {
                sum += d;
            }

            return sum;
        }

        public static double Average(double[] p) {
            return Sum(p) / p.Length;
        }
    }
}
